
class people:
    #姓名
    _name = ""
    #性别
    _gender = ""
    #年龄
    _age = 0
    #爱好
    _hobby = ""

    def __init__(self,name,gender,age,hobby):
        self._name = name
        self._gender = gender
        self._age = age
        self._hobby = hobby

    def getName(self):
        return self._name

    def getGender(self):
        return self._gender

    def getAge(self):
        return self._age

    def getHobby(self):
        return self._hobby

    def setName(self,name):
        self._name = name

    def setGender(self,gender):
        self._gender = gender

    def setAge(self,age):
        self._age = age

    def setHobby(self,hobby):
        self._hobby = hobby

    def speak(self):
        print("%s 说：我 %d 岁。" %(self._name,self._age))





class main:
    p = people("小明","男",23,"跑步")
    #p.speak()

    p.setHobby("玩游戏")
    print(p.getHobby())